package com.maikobi.maikobi.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;

/**
 * 配置类，用于定义密码编码器 bean
 * @author: Maiko7
 * @create: 2025-07-13 19:39
 */
@Configuration
public class PasswordEncoderConfig {

    /**
     * 创建并返回一个 PasswordEncoder 实例，用于密码的编码与比对
     *
     * @return PasswordEncoder 实例，这里使用的是 BCryptPasswordEncoder
     */
    @Bean
    public PasswordEncoder passwordEncoder() {
        return new BCryptPasswordEncoder();
    }



}

